package org.example.auth.repository;

import org.example.auth.model.entity.UserRole;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

public interface UserRoleRepository extends JpaRepository<UserRole, Long> {

    List<UserRole> findByUserId(Long userId);

    Optional<UserRole> findByUserIdAndDefaultFlagTrue(Long userId);

    List<UserRole> findByRoleId(Long roleId);

    List<UserRole> findByRoleIdIn(List<Long> roleIds);

    Optional<UserRole> findByUserIdAndRoleId(Long userId, Long roleId);


}
